/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "scthtbnivacade")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Scthtbnivacade.findAll", query = "SELECT s FROM Scthtbnivacade s"),
    @NamedQuery(name = "Scthtbnivacade.findByScthtbnivacadeid", query = "SELECT s FROM Scthtbnivacade s WHERE s.scthtbnivacadeid = :scthtbnivacadeid"),
    @NamedQuery(name = "Scthtbnivacade.findByNombre", query = "SELECT s FROM Scthtbnivacade s WHERE s.nombre = :nombre"),
    @NamedQuery(name = "Scthtbnivacade.findByObservaciones", query = "SELECT s FROM Scthtbnivacade s WHERE s.observaciones = :observaciones")})
public class Scthtbnivacade implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "scthtbnivacadeid")
    private Integer scthtbnivacadeid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nombre")
    private String nombre;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "scthtbnivacadeid")
    private Collection<Scthtbtitulosa> scthtbtitulosaCollection;
    @OneToMany(mappedBy = "scthtbnivacadeid")
    private Collection<Sctstbtesis> sctstbtesisCollection;

    public Scthtbnivacade() {
    }

    public Scthtbnivacade(Integer scthtbnivacadeid) {
        this.scthtbnivacadeid = scthtbnivacadeid;
    }

    public Scthtbnivacade(Integer scthtbnivacadeid, String nombre, String observaciones) {
        this.scthtbnivacadeid = scthtbnivacadeid;
        this.nombre = nombre;
        this.observaciones = observaciones;
    }

    public Integer getScthtbnivacadeid() {
        return scthtbnivacadeid;
    }

    public void setScthtbnivacadeid(Integer scthtbnivacadeid) {
        this.scthtbnivacadeid = scthtbnivacadeid;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    @XmlTransient
    public Collection<Scthtbtitulosa> getScthtbtitulosaCollection() {
        return scthtbtitulosaCollection;
    }

    public void setScthtbtitulosaCollection(Collection<Scthtbtitulosa> scthtbtitulosaCollection) {
        this.scthtbtitulosaCollection = scthtbtitulosaCollection;
    }

    @XmlTransient
    public Collection<Sctstbtesis> getSctstbtesisCollection() {
        return sctstbtesisCollection;
    }

    public void setSctstbtesisCollection(Collection<Sctstbtesis> sctstbtesisCollection) {
        this.sctstbtesisCollection = sctstbtesisCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (scthtbnivacadeid != null ? scthtbnivacadeid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Scthtbnivacade)) {
            return false;
        }
        Scthtbnivacade other = (Scthtbnivacade) object;
        if ((this.scthtbnivacadeid == null && other.scthtbnivacadeid != null) || (this.scthtbnivacadeid != null && !this.scthtbnivacadeid.equals(other.scthtbnivacadeid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Scthtbnivacade[ scthtbnivacadeid=" + scthtbnivacadeid + " ]";
    }
    
}
